<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var x = 1,
				y = z = 0;

			function add(n) {
				return n = n + 1;
			}

			y = add(x);  // y = 4

			function add(n) {
				return n = n + 3;
			}

			z = add(x); // z = 4;

			console.log(x, y, z); //1, 4, 4
		</script>
	</body>
</html>
